﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ResourceSelector.ascx.cs" ClassName="ResourceSelector" Inherits="Hxsoft.AppV1._Controls.ResourceSelector" %>
<script type="text/javascript">
function <%= this.ClientID %>_Reload()
{
	var o = $("#<%= CtrReloadButton.ClientID %>");
	if(o.length > 0)
	{
		try { __doPostBack("<%= CtrReloadButton.UniqueID %>", ""); }
		catch(e) {}
	}
}

<%= GetClickResourceItemScript() %>
</script>
<div class="resourceSelector">
	<div class="uploadBox">
		<iframe src="<%= GetUploaderUrl() %>" frameborder="0" style="width:100%; height:30px; border:0;"></iframe>
	</div>
	<asp:UpdatePanel ID="CtrUpdateList" runat="server">
			<ContentTemplate>
	<asp:LinkButton ID="CtrLoadDataButton" CausesValidation="false" visible="false" runat="server" 
		onclick="CtrLoadDataButton_Click"><%= LoadDataButtonText %></asp:LinkButton>
	<div id="CtrLoadDataContainer" runat="server">
		<div class="searchBox">
			<asp:TextBox ID="CtrKeyword" runat="server"></asp:TextBox>
			<asp:Button ID="CtrSearchButton" runat="server" CausesValidation="false" onclick="CtrSearchButton_Click" />
			<asp:LinkButton ID="CtrReloadButton" CausesValidation="false" runat="server" 
				onclick="CtrReloadButton_Click" />
		</div>
		<div class="listBox clearfix">
			<asp:Repeater ID="CtrList" runat="server" ondatabinding="CtrList_DataBinding" 
				OnItemDataBound="CtrList_ItemDataBound" onitemcommand="CtrList_ItemCommand">
				<ItemTemplate>
					<asp:HiddenField ID="CtrResourceId" Value='<%# Eval("ResourceId") %>' runat="server" />
					<div class="resourceItemBox">
						<div class="resourceToolbar">
							<a href="javascript:<%= this.ClientID %>_OpenResource({'resourceId' : '<%# Eval("ResourceId") %>', 'resourceType' : '<%# Eval("ResourceType") %>'})"><img src="/_Client/Controls/ResourceSelector/zoomin.jpg" alt="<%= ZoomInText %>" class="opIco" /></a>
							<asp:ImageButton ID="CtrDeleteResourceButton" ImageUrl="/_Client/Controls/ResourceSelector/delete.jpg" CommandName="Delete" CausesValidation="false" AlternateText="<%# DeleteText %>" CssClass="opIco" runat="server" />
						</div>
						<div class="resourceIcoBox"><asp:Literal ID="CtrResourceIcoBox" runat="server"></asp:Literal></div>
						<div class="resourceTextBox"><asp:Literal ID="CtrResourceTextBox" runat="server"></asp:Literal></asp:Literal></div>
					</div>
				</ItemTemplate>
			</asp:Repeater>
		</div>
		<div class="pagerBox">
			<Hxctr:AspNetPager ID="CtrPager" runat="server" 
				onpagechanging="CtrPager_PageChanging"></Hxctr:AspNetPager>
		</div>
	</div>
		</ContentTemplate>
		<Triggers>
			<asp:AsyncPostBackTrigger ControlID="CtrSearchButton" EventName="Click" />
			<asp:AsyncPostBackTrigger ControlID="CtrReloadButton" EventName="Click" />
			<asp:AsyncPostBackTrigger ControlID="CtrLoadDataButton" EventName="Click" />
		</Triggers>
	</asp:UpdatePanel>
</div>